package solitaire.gui;

import solitaire.deck.*;

import java.awt.Graphics;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;

import javax.swing.JPanel;

public class MousePanel extends JPanel
{
	//TODO: create one instance of a single card
	
    public MousePanel( )
    {
    	
    	//TODO: set the location of the created card
    	card.
    	
		//h�r er kalla� � mouselistener sem er skilgreindur ne�ar.
        addMouseListener( new MouseHandler( ) );
        //h�r er kalla� � mousemotionlistener sem er skilgreint ne�ar.
        addMouseMotionListener( new MouseMotionHandler( ) );
    }

    //h�r er teiknifall sem tekur inn Graphic.
    public void paintComponent(Graphics g)
    {
    	//h�r notar falli� erf�ir fr� grunnklasanum.
        super.paintComponent(g);
        
        //TODO: drawCard
    }
    
  
    //Mousehandler sem kalla� var � inni � constructornum fyrir MousePanel.
    private class MouseHandler extends MouseAdapter
    {
    	//�etta fall er a� sko�a ef �tt er � m�sina.
        public void mousePressed(MouseEvent event)
        {
        	
        }

        //�etta fall athugar ef tv�klikka� er.
        public void mouseClicked(MouseEvent event)
        {
        	
        }
    }
    
    //H�r er MouseMotionHalder sem kalla� var � inni � constructornum fyrir MousePanel.
    private class MouseMotionHandler implements MouseMotionListener
    {
    	//H�r er hlusta� eftir �v� ef m�sin var hreyf�.
        public void mouseMoved(MouseEvent event)
        {
        	
        }

        //H�r er hlusta� eftir �v� ef m�sin er dregin.
        public void mouseDragged(MouseEvent event)
        {
        	//TODO: check if mouse cursor was on card when pressed (use event.getPoint() )
        	//if()
        	{
        		//TODO: if card was found then set new location for card (use event.getX() and event.getY() )
        	}
        	repaint();
        }
    }
}

